import { DictItem, PrismaClient } from '@prisma/client'
import { hash } from 'argon2'

const prisma = new PrismaClient()
const quyu_list = ['陆家', '千灯', '张浦', '花桥']
async function run() {
  await prisma.adminUser.create({
    data: {
      user_name: 'admin',
      nick_name: '管理员',
      password: await hash('123'),
    },
  })
  const dict = await prisma.dict.create({
    data: {
      dict_name: '区域',
      dict_mark: 'QUYU',
    },
  })
  let dict_items = quyu_list.map((item) => {
    return {
      dictId: dict.id,
      item_label: item,
      item_value: item,
    } as DictItem
  })
  await prisma.dictItem.createMany({
    data: dict_items,
  })
}

run()
